
export default {
  state: {
    user:null
  },
  mutations: {
    SET_USER: (state,user)=>{
      state.user = user
    }
  },
  actions: {
    getUserInfo({commit}){
      return new Promise((resolve)=>{
        let user = {
          name:'rouzi',
          roles:['100',
                 '200',
                    '210',
                 '300',
                    '310',
                    '330',
                      '331',
                 '500'
                ], //权限
        }
        commit('SET_USER',user)
        resolve(user)
      })
    },
    setUserInfo({commit},data){
      return new Promise((resolve)=>{
        let user = {
          name:'rouzi',
          roles: data
        }
        commit('SET_USER',user)
        resolve(user)
      })
    }
  },
}
